import axios from 'axios'

export function createOrder(data) {
  return axios.post('/order', data)
}

export function getOrderList() {
  return axios.get('/order/list')
}

export function getOrderDetail(id) {
  return axios.get(`/order/${id}`)
}

export function cancelOrder(id) {
  return axios.put(`/order/${id}/cancel`)
}

// 管理端接口
export function getAdminOrders(params) {
  return axios.get('/admin/order', { params })
}

export function updateOrderStatus(id, status) {
  return axios.put(`/admin/order/${id}/status`, { status })
}

